﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎登录</title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../../js/jquery-1.8.3.js" type="text/javascript"></script>
    <script src="../../js/cloud.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        if (window != window.top) {
            window.top.location.href = window.location.href;
        }
        $(function () {
            $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            $(window).resize(function () {
                $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            });
            $("#name").focus();

            $('#pwd,#name').keydown(function (e) {
                if (e.keyCode == 13) {
                    login();
                }
            });
        });
        function login() {
            var name = $("#name").val();
            var pwd = $("#pwd").val();
            if (name.length <= 0) {
                alert("请输入用户名");
                return false;
            }
            if (pwd.length <= 0) {
                alert("请输入密码");
                return false;
            }
            $.ajax({
                url: '../../service/Password.ashx',
                type: "post",
                data: { action: "Login", name: name, pwd: pwd, r: Math.random() },
                dataType: "json",
                success: function (result) {
                    if (!result.error) {
                        location.href = "index.html";
                    } else {
                        $("#pwd").val("").focus();
                        alert(result.msg);
                    }
                },
                error: function (x, h, c) {

                }
            });
        }

    </script>
</head>
<body style="background-color: #1c77ac; background-image: url(../../images/light.png);
    background-repeat: no-repeat; background-position: center top; overflow: hidden;">
    <div id="mainBody">
        <div id="cloud1" class="cloud">
        </div>
        <div id="cloud2" class="cloud">
        </div>
    </div>
    <div class="loginbody">
        <span class="systemlogo"></span>
        <div class="loginbox">
            <form id="login-fm" method="post">
            <ul>
                <li>
                    <input id="name" name="name" type="text" class="loginuser" value="admin" />
                </li>
                <li>
                    <input id="pwd" name="pwd" type="password" class="loginpwd" value="admin" />
                </li>
                <li>
                    <input name="" type="button" class="loginbtn" value="登录" onclick="login()" />
                </li>
            </ul>
            </form>
        </div>
    </div>
    <div class="loginbm">
        版权所有 2014 <a href="http://www.youotech.com/">youotech.com</a>
    </div>
</body>
</html>
